package rad.framework.jsf;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.ConverterException;

/**
 * This is essentially a noop converter.
 * 
 * @author boudyacho
 * 
 */
public class StringConverter implements Converter {

	public Object getAsObject(FacesContext context, UIComponent comp,
			String value) throws ConverterException {
		return value;
	}

	public String getAsString(FacesContext ctx, UIComponent comp, Object object)
			throws ConverterException {
		if (object == null) {
			return null;
		}
		return object.toString();
	}
}
